from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from time import sleep
from options import options

driver = webdriver.Chrome(options=options)
driver.get(r'https://www.baidu.com/')
sleep(3)
driver.find_element(By.LINK_TEXT,'hao123').click()
sleep(3)
driver.switch_to.window(driver.window_handles[1])
driver.close()
sleep(3)
driver.close()
sleep(3)
driver.quit()